from django.conf.urls import patterns, include, url
from advertising_app.views import *
from django.contrib.auth.views import login, logout

# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()

urlpatterns = patterns('',
    # Examples:
    # url(r'^$', 'GoodDeal.views.home', name='home'),
    # url(r'^GoodDeal/', include('GoodDeal.foo.urls')),

    # Uncomment the admin/doc line below to enable admin documentation:
    # url(r'^admin/doc/', include('django.contrib.admindocs.urls')),

    url(r'^$',home_view),
    # Uncomment the next line to enable the admin:
    
    url(r'^search/$',search_view),
    url(r'^advertisements/$',advertisements_view),
    url(r'^advertisements/add/$',add_new_advertisement_view),
    url(r'^contact/$',contact_view),
    url(r'^admin/', include(admin.site.urls)),
    url(r'^accounts/login/$',login),
    url(r'^accounts/logout/complete/$',logged_out_view),
    url(r'^accounts/logout/$',logout,{'next_page':'/accounts/logout/complete/'}),
    url(r'^accounts/profile/$',profile_view),
    url(r'^accounts/register/complete/$',register_complete_view),
    url(r'^accounts/register/$',register_view),
#    url(r'^accounts/',include('django.contrib.auth.urls')),
    
    
    url(r'^advertisements/(?P<ad_id>\d+)/$', detailed_advertisement_view),
)
